import Mock from 'mockjs'
//const Random = Mock.Random;
import {
	urlParams2Obj
} from './utils.js'
//import qs from 'qs'

//生成模拟数据 : 

//1首页快捷入口列表
//参数 无
//返回数据结构 参见 result
Mock.mock(new RegExp('/enterList'), 'get', options => {
	const {
		url
	} = options;
	const query = urlParams2Obj(url);
	console.log('接口 /enterList 参数', query)

	let dataList = [{
			title: '新闻资讯',
			routeName: 'working',
			img: require('@/assets/images/menu1.png')
		},
		{
			title: '图片分享',
			routeName: 'working',
			img: require('@/assets/images/menu2.png')
		},
		{
			title: '商品购买',
			routeName: 'goodsList',
			img: require('@/assets/images/menu3.png')
		},
		{
			title: '留言反馈',
			routeName: 'working',
			img: require('@/assets/images/menu4.png')
		},
		{
			title: '视频专区',
			routeName: 'working',
			img: require('@/assets/images/menu5.png')
		},
		{
			title: '联系我们',
			routeName: 'working',
			img: require('@/assets/images/menu6.png')
		},
		{
			title: '联系AA',
			routeName: 'working',
			img: require('@/assets/images/menu6.png')
		}
	]

	const result = {
		code: 200,
		msg: "成功获取",
		data: {
			list: dataList
		}
	}
	return result;
});
